/*
 * music.h
 *  Created on: 2019.1.26
 *      Author: mxw
 */
#ifndef _MUSIC_H_
#define _MUSIC_H_

//低音
#define YINJIE_BASS_1 2981
#define YINJIE_BASS_2 2657
#define YINJIE_BASS_3 2367
#define YINJIE_BASS_4 2232
#define YINJIE_BASS_5 1992
#define YINJIE_BASS_6 1775
#define YINJIE_BASS_7 1581

//中音
#define YINJIE_AlTO_1 1490
#define YINJIE_AlTO_2 1365
#define YINJIE_AlTO_3 1183
#define YINJIE_AlTO_4 1119
#define YINJIE_AlTO_5 996
#define YINJIE_AlTO_6 887
#define YINJIE_AlTO_7 790

//高音
#define YINJIE_TREBLE_1 746
#define YINJIE_TREBLE_2 665
#define YINJIE_TREBLE_3 592
#define YINJIE_TREBLE_4 559
#define YINJIE_TREBLE_5 498
#define YINJIE_TREBLE_6 444
#define YINJIE_TREBLE_7 395

//海豚音
#define YINJIE_DOLPHIN_1 373
#define YINJIE_DOLPHIN_2 332
#define YINJIE_DOLPHIN_3 296
#define YINJIE_DOLPHIN_4 279
#define YINJIE_DOLPHIN_5 249
#define YINJIE_DOLPHIN_6 221
#define YINJIE_DOLPHIN_7 197

extern unsigned int freqTab[];

struct Music_t {
    char c1;
    char c2;
    char* geci;
};

/*         c1                 c2
 *  0 0 0 0  0 0 0 0   0 0 0 0  0 0 0 0
 *        - -------------- ------------
 *        |      |_yingao       |___shichang
 *        |
 *        |_kongxi
 * */
void Buzzer_Freq_Set(unsigned int freq);
void Buzzer_Stop( void );
void init_music();
void request_to_stop();
void new_muisc_go();

#endif

